<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Using Programmer's Notepad</title>
<link href="css/tutorial.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="css/precodeformat.js"></script>
</head>

<body onload="PreCodeFormat()">
<div id="content">
<h1>Using Programmer's Notepad</h1>

<p>
"Programmer's Notepad" is a text editor that is packaged with the devkitPro installer.
We will use it to view and edit the source code to our GBA game.
</p>

<p>
While "Programmer's Notepad" is convenient because it is already installed for as part
of the devkitPro installation, you should feel free to use whatever text editor you
prefer.
</p>

<hr/>

<h2>Step 1 : Launch Programmer's Notepad</h2>

<p>
The easiest way to launch Programmer's Notepad is to find the <tt>.pnproj</tt>
file in your project's directory. This file is automatically generated
by Spritely when you "Export" your project.
</p>

<p><img src="using_pn/pnproj.png" /></p>

<p>
After double-clicking this file, Programmer's Notepad will load your
project:
</p>

<p><img src="using_pn/project_small.png" /></p>

<p>
The project source files are shown in a window on the left side.
These are the files that are used to build your GBA project. You'll be
editing these files in later tutorials.
</p>

<p>
If you see extra windows open in Programmer's Notepad, feel free to close
them to reduce clutter.
</p>

<h2>Step 2 : Edit a source file</h2>

<p>
To open a source file, just double-click on the icon next to the filename.
</p>

<p><img src="using_pn/source1_small.png" /></p>

<p>
To make the window so that it fills the entire workspace, press the "Maximize" button
in the upper-right corner of the window.
</p>

<p><img src="using_pn/window_buttons.png" /></p>

<p>
This will allow you to see more of the file at a time (which makes it easier to make
changes to the code).
</p>

<p><img src="using_pn/source2_small.png" /></p>

<h2>Step 3 : Build/Run from within Programmer's Notepad</h2>

<p>
One nice feature of "Programmer's Notepad" is that you can build and run your GBA project
easily without switching to another application.
</p>

<p>
To build your project, select "make" from the "Tools" menu.
</p>

<p><img src="using_pn/menu_make.png" /></p>

<p>
This will open up an "Output" window at the bottom of the workspace and automatically
enter the make command for you.
</p>

<p><img src="using_pn/output_small.png" /></p>

<p>
The output of the <tt>make</tt> command will be displayed in this output window.
</p>

<p>
If you see
</p>

<pre class="code">
ROM fixed!
</pre>

<p>for GBA projects, or</p>

<pre class="code">
build ... mygame.nds
</pre>

<p>for NDS projects, or a message that ends with</p>

<pre class="code">
... is up to date.
</pre>

<p>
at the end of the ouput, then your project was built successfully.
</p>

<p>
To run your program after it's built, select "run" from the "Tools" menu.
</p>

<p><img src="using_pn/menu_run.png" /></p>

<p>
If you've already made the file association (as shown in
<a href="run_gba_rom.html">Running your GBA ROM</a>
tutorial), then this will automatically launch VisualBoy Advance with your ROM.
</p>

<p><img src="using_pn/ss_01.png" /></p>

<h2>Finished!</h2>

<p>
That's all.
</p>

<div id="footer_bkgd"><div id="footer">
<p>Copyright &copy;2008-9 Gary Kacmarcik</p>
</div></div>

</div>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1163903-2");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>
